@extends("backend.layout.main")
@section("right_content")
    <style type="text/css">
        * {
            box-sizing: border-box;
        }
    </style>
    <!--middle-->
    <div class="mainWrapBox">
        <div class="mainBox">

            <h1>
                <a href="/backend/items">项目</a> / {{ $itemsInfo['item_name'] }}
                <span class="projects-nav">

    <a href="/backend/items/task/{{ $itemsInfo['id'] }}">任务</a>
    <a class="current-nav" href="/backend/items/show/{{ $itemsInfo['id'] }}">基本信息</a>
</span> </h1>

            <div class="project-main">
                <div class="html mt20">
                    <div class="right-part">
                        <div class="data-panel panel-height">
                            <h2 class="pl20 pr20">项目位置</h2>
                            <div class="pl20 pr20 mt10" style="height: 350px">
                                <div id="map" style="width: 330px; height: 330px; border: 1px solid rgb(228, 228, 228); display: block;">
                                </div>

                            </div>
                        </div>
                        <div class="data-panel panel-height mt20">

                        </div>
                    </div>
                    <div class="left-part">
                        <div class="data-panel panel-height">

                            <h2 class="pl20 pr20">基本信息
                                <ul class="xiansuo_tl" style="float: right">
                                    @if($itemsInfo['item_status']<0)
                                        <li id="check" data-id="0" onclick="checkItem(this);">发起审核</li>
                                    @endif
                                    <li id="edit">编辑</li>
                                </ul>
                            </h2>


                            <table cellpadding="0" cellspacing="0" class="xiansuo_tab" style="margin-left: 20px;width: 90%">
                                <tbody><tr>
                                    <td width="140" align="left">意见回复日</td>
                                    <td width="350" align="left"> {{ $itemsInfo['idea_deadline'] }}
                                    </td>
                                    <td width="140" align="left">项目经理：</td>
                                    <td width="350" align="left">{{ $itemsInfo['member_id'] }}</td>
                                </tr>

                                <tr>
                                    <td width="140" align="left">情况描述：</td>
                                    <td width="350" align="left">{{ $itemsInfo['item_describe'] }}
                                    </td>
                                    <td width="140" align="left">项目状态：</td>
                                    <td width="350" align="left" id="project_status">
                                        {{ $itemsInfo['item_status'] }}

                                    </td>
                                </tr>
                                <tr>
                                    <td width="140" align="left">考核要求：</td>
                                    <td width="350" align="left"> {{ $itemsInfo['item_check'] }}</td>
                                    <td width="140" align="left">保留价：</td>
                                    <td width="350" align="left"> {{ $itemsInfo['item_price'] }}</td>
                                </tr>
                                <tr>
                                    <td width="140" align="left">竞价截止日：</td>
                                    <td width="350" align="left">{{ $itemsInfo['bidding_deadline'] }}</td>

                                    <td width="140" align="left">项目完成日：</td>
                                    <td width="350" align="left"> {{ $itemsInfo['item_deadline'] }}</td>
                                </tr>

                                <tr>
                                    <td width="140" align="left">约定设计费：</td>
                                    <td width="350" align="left">{{ $itemsInfo['item_design'] }}
                                    </td>

                                    <td width="140" align="left">项目所在地：</td>
                                    <td width="350" colspan="3" align="left">
                                        {{ $itemsInfo['item_address'] }}
                                    </td>

                                </tr>
                                </tbody></table>
                            <div style="margin-left: 20px;">

                            </div>
                            <div style="margin-left: 20px;">
                                <ul class="xiansuo_wenjian" id="fileNameListId"></ul>
                            </div>

                        </div>
                        <div class="data-panel panel-height mt20" style="padding: 0 20px 10px 20px;width:100%;height:100%;">
                            <div class="xiansuo_left_title border_none">
                                <span>审核意见</span>
                            </div>
                            <div class="goutong_text left">
                                <div class="goutong_pic left"><img src="{{ session('member')['img'] }}"></div>
                                <div class="goutong_list left" style="width:89%;">
                                    <form>
                                        <input type="hidden" name="activity.pid" value="0">
                                        <input type="hidden" name="type" value="5">
                                        <input type="hidden" name="orgId" value="5">
                                        <input type="hidden" name="nodeId" value="2539">
                                        <input type="hidden" name="activityForeignId" value="493">
                                        <div class="goutong_list_tea left" style="width:100%;">
                                            <textarea class="gou_te" name="activity.content" style="width:100%;"></textarea>
                                        </div>
                                        <div class="goutong_list_bgs left">
                                            <div class="goutong_list_fb right">
                                                <a href="javascript:;" onclick="cancelActivity(this);">取消</a>
                                                <a class="fabu" href="javascript:;" onclick="checkItem(this);">发布</a>
                                            </div>
                                            <div class="cl"></div>
                                        </div>
                                    </form>

                                </div>

                            </div>
                        </div>

                        <div class="mindadd" style="width:100%;height:100%;background-color:#fff;padding: 0 20px 10px 20px;">
                            @if($itemsInfo['posts'])
                                @foreach($itemsInfo['posts'] as $k=>$v)
                                    <div id='big' style='width:1270px;margin-top:30px;height:100%;'>
                                        <div class='goutong_pic left'>
                                            <img src='{{ session('member')['img'] }}' width='48' height='48' />
                                        </div>
                                        <span style='color: #009dc8;font-size: 14px;margin-left: 7px;'>{{ $v['member_id'] }}</span>
                                        <div id='times' style='color: #009dc8;width: 141px;height: 19px;float: right;font-size: 12px;'>
                                            {{ $v['created_at'] }}
                                        </div><br/>
                                        <div class='gou_te2'style='width: 1204px;border: 0px;margin-left: 56px;'>
                                            {{ $v['content'] }}
                                        </div>
                                    </div>
                                @endforeach
                            @endif



                        </div>



                        <script type="text/javascript">
                            function checkItem(obj){
                                //alert($(this));
                                var action=$(obj).attr('data-id');
                                var url="/backend/items/check/{{ $itemsInfo['id'] }}";
                                var content=$(".gou_te").val();
                                var

                                $.post(url,{action:action,content:content},function(data){
                                    if(data==0){
                                        alert('操作失败，请重试！');
                                    }else {
                                        if(action=="0"){
                                            $(obj). remove();
                                            alert('已通知相关人员处理！' );
                                        }else{
                                            var myDate = new Date();
                                            var date=myDate.toLocaleString( );        //获取日期与时间
                                            var html="<div id='big' style='width:1270px;margin-top:30px;height:100%;'><div class='goutong_pic left'><img src='./基本信息_files/d443f829-0ae4-47cc-b1e8-90c4515a7894.jpg' width='48' height='48' /></div><span style='color: #009dc8;font-size: 14px;margin-left: 7px;'>李知远</span><div id='times' style='color: #009dc8;width: 141px;height: 19px;float: right;font-size: 12px;'>"+date+"</div><br/><div class='gou_te2'style='width: 1204px;border: 0px;margin-left: 56px;'>"+content+"</div></div>";
                                            $(".gou_te").val("");
                                            $(".goutong_text.left").after(html);
                                            alert('已通知相关人员处理！' );
                                        }
                                    }

                                },"text");

                            }
                            /*function addActivity(){
                                var $index=$(".gou_te").val();
                                $(".gou_te").val("");
                                var myDate = new Date();
                                var date=myDate.toLocaleString( );        //获取日期与时间
                                var html="<div id='big' style='width:100%;margin-bottom: 15px;height:100%;'><div style='margin-right: 65px;'><div class='.goutong_pic left' style='width:46px;height:46px;'><img src='images/d443f829-0ae4-47cc-b1e8-90c4515a7894.jpg' style='width: 46px;height: 46px;'/></div><span style='color: #009dc8;font-size: 14px;margin-left: 7px;'>李知远</span><div id='times' style='color: #009dc8;width: 141px;height: 19px;float: right;font-size: 12px;'>"+date+"</div><br/><div class='gou_te2'style='width: 100%px;border: 0px;margin-left: 64px;min-height: 48px;'>"+$index+"</div></div>";

                                $(".mindadd").prepend(html);
                            }
*/
                            $(function(){
                                $('.perMesg').mouseenter(function(){
                                    $(this).find('dd').addClass('showTrsm');
                                }).mouseleave(function(){
                                    $(this).find('dd').removeClass('showTrsm');
                                })
                            })
                        </script>

                    </div>
                </div>
            </div>
        </div>
        @endsection